#include <iostream>
#include <cassert>

using namespace std;
int sum(int n);

int main(){
	int n = 10;
	int s = sum(n);
	cout << s << endl;
}

// 递归深度是n,  O(n)
int sum(int n){
	assert(n >= 0);
	if(n == 0)
		return 0;
	return n += sum(n-1);
}
